// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the CW32WINDOW_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// CW32WINDOW_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.

#pragma once
#include "ExportSymbol.h"
#ifndef __SWIG__
#include <string>
#include <Python.h>
#include <vector>
#include <string>
#endif
#include "CComm.h"
#include "CBaseWin.h"
#include "CEventManager.h"
#include "Keys.h"

class CW32Window : public CBaseWnd, public CEventManager, public IDropSource, public IDropTarget, public CRefCount

{
protected:



#ifndef __SWIG__
	//////Drag and Drop/////
	DWORD m_dwFeedbackEffect;
	std::vector<std::wstring>	m_lsDroppedFiles;

	////////////////////////////
	virtual LRESULT OnMouseMessage(UINT message, int x, int y, int dx, int dy, int zDelta, int keyState);
	virtual LRESULT OnKeyboardMessage(UINT message, UINT nChar, UINT nRepCnt);
	virtual BOOL _ProcKeyMsg(UINT message, UINT nChar, UINT nRepCnt);

	virtual LRESULT OnActivate(UINT actType, BOOL bMinimize, long hwnd);
	virtual LRESULT OnActivateApp(BOOL bActivate, long hThread);
	virtual LRESULT OnClose();
	virtual LRESULT OnPaint();
	virtual LRESULT OnCreate(CREATESTRUCT* pCreateInfo);
	virtual LRESULT OnDestory();
	virtual LRESULT OnEnable(BOOL bEnable);
	virtual LRESULT OnEnterSizeMove();
	virtual LRESULT OnExitSizeMove();
	virtual LRESULT OnGetMinMaxInfo(MINMAXINFO* pInfo);
	virtual LRESULT OnMove(int x, int y);
	virtual LRESULT OnMoving(RECT* prect);
	virtual LRESULT OnNCActivate(BOOL bActivate, long hRgn);
	virtual LRESULT OnNCCreate(CREATESTRUCT* pCreateInfo);
	virtual LRESULT OnNCDestory();
	virtual LRESULT OnNullMessage();
	virtual LRESULT OnQuit(int nExitCode);
	virtual LRESULT OnCancelMode();
	virtual LRESULT OnQueryDragIcon();
	virtual LRESULT OnQueryOpen();
	virtual LRESULT OnShowWindow(BOOL bShow, UINT status);
	virtual LRESULT OnSize(UINT width, UINT height, UINT nFlag);
	virtual LRESULT OnSizing(RECT* pRect, UINT nFlag);
	virtual LRESULT OnStyleChanged(int styleType, STYLESTRUCT* pStyleInfo);
	virtual LRESULT OnStyleChanging(int styleType, STYLESTRUCT* pStyleInfo);
	virtual LRESULT OnThemeChanged();
	virtual LRESULT OnUserChanged();
	virtual LRESULT OnWindowPosChanged(WINDOWPOS* pwndPos);
	virtual LRESULT OnWindowPosChanging(WINDOWPOS* pwndPos);

	//Drag and Drop
	virtual DWORD QuertyDropEffect(DWORD dwKeyState, POINTL* pt);

#endif


public:
	CW32Window();
	~CW32Window();
	virtual HRESULT Create(HWND hwndParent, UINT wndWidth, UINT wndHeight, const WCHAR* pWndName, UINT classStyle /* = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS */, UINT windowStyle /* = WS_MINIMIZEBOX| WS_MAXIMIZEBOX | WS_OVERLAPPEDWINDOW  */, UINT windowExStyle /* = WS_EX_APPWINDOW | WS_EX_ACCEPTFILES | WS_EX_LAYERED */, int winPosX = CW_USEDEFAULT, int winPosY = CW_USEDEFAULT);

	//Drag and Drop
	virtual void DoDragDrop(const WCHAR* files, UINT lens, const char* muiClipInfo, UINT muiClipLen,
		BOOL allowMove = TRUE, BOOL allowCopy = TRUE);
	/* IDropSource methods */
	virtual HRESULT __stdcall QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
	virtual HRESULT __stdcall GiveFeedback(DWORD dwEffect);

	/* IDropTarget methods */
	virtual HRESULT __stdcall DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
	virtual HRESULT __stdcall DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
	virtual HRESULT __stdcall DragLeave();
	virtual HRESULT __stdcall Drop( IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);

	/* IUnknown */

	virtual HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObject);
	virtual ULONG __stdcall AddRef();
	virtual ULONG __stdcall Release();
};


